import java.util.Scanner;


public class Monster 
{
	static int health = 20;
	int speed = 2;
	static int str = 3;
	int level = 1;
	static int exp = 30;	
	
	public static void attackplayer()
	{
		System.out.println("The Monster goes for you and slashes you!");
		Player.health -= str;
	}
	
	public static void expdrop()
	{
		Player.exp += exp;
		System.out.println("You gain some experience from the fight!");
	}
	
	public static void death()
	{
		System.out.println("The Monster dies!");
		expdrop();
		Monster.health = 20;
		//death
	}

	public static void monsterfight()
	{
			do
			{
				@SuppressWarnings("resource")
				Scanner attack = new Scanner(System.in);
				Main.a = attack.nextInt();
						if(Main.x == 1)
						{
							PlayerBow.attackbow();
							if(Monster.health <= 0)
							{
								Monster.death();
								Main.a = 0;
							}
							
							else if(Monster.health > 0)
							{
								Monster.attackplayer();
							}
							
							if(Player.exp >= 50)
							{
								Main.levelup();
							}
							
						    if(PlayerBow.health <= 0)
							{
								break;
							}
							
						}
						if(Main.x == 2)
						{
							PlayerSword.attacksword();
							if(Monster.health <= 0)
							{
								Monster.death();
								Main.a = 0;
							}
							
							else if(Monster.health > 0)
							{
								Monster.attackplayer();
							}
							
							if(Player.exp >= 50)
							{
								Main.levelup();
							}
							
						    if(PlayerBow.health <= 0)
							{
								break;
							}
						}
			}while(Main.a == 1);
		}


}
